################################################
# Analysis for:
#
# Jordan, Soren, Kim Quaile Hill, and Patricia A. Hurley. 2017. "Constituency Representation in
#  Congress: In General and in Periods of Higher and Lower Partisan Polarization." In Congress 
#  Reconsidered, eds. Lawrence C. Dodd and Bruce I. Oppenheimer. Eleventh edition. 
#  Los Angeles: Congressional Quarterly Press, pp. 119-137.
#
# Required files: CQPolicyTrack.csv
#                 Final Polarization Data 2012.csv
#
################################################


library(ggplot2)

datafake <- data.frame(X1 = -10, X2 = 10, 
	X3 = 0, Y1 = -10, Y2 = 10, Y3 = 0)

# Figure 1
pdf("*", width = 6, height = 4)
p <- ggplot(datafake, aes(x = X3, y = Y3))
p + geom_segment(aes(x = X1, y = Y3, 
		xend = X2, yend = Y3), 
		arrow = arrow(ends = "both"), lwd = 2) +
	geom_segment(aes(x = X3, y = Y1, 
		xend = X3, yend = Y2), 
		arrow = arrow(ends = "both"), lwd = 2) +
	theme(axis.ticks = element_blank(), 
		axis.text.x = element_blank(),
		axis.text.y = element_blank(), 
		axis.title.x = element_blank(),
		axis.title.y = element_blank()) +
	ylab("") + xlab("") +
	annotate("text", x = -11.5, y = 0, 
		label = "LOW", fontface = "bold", lwd = 5) +
	annotate("text", x = 11.5, y = 0, 
		label = "HIGH", fontface = "bold", lwd = 5) +
	annotate("text", x = 0, y = 11, 
		label = "CROSS CUTTING", fontface = "bold", lwd = 5) +
	annotate("text", x = 0, y = -11, 
		label = "PARTY DEFINING", fontface = "bold", lwd = 5) +
	annotate("text", x = -7, y = 8, 
		label = "Belief Sharing or") +
	annotate("text", x = -7, y = 7, 
		label = "Instructed Delegate Representation") +
	annotate("text", x = -7, y = -8, 
		label = "Responsible Party Representation") +
	annotate("text", x = 7, y = 8, 
		label = "Trustee Representation") +
	annotate("text", x = 7, y = -8, 
		label = "Party Elite Led Representation") +
	annotate("text", x = -4, y = -1, 
		label = "Complexity of the Issue") +
	annotate("text", x = 0.75, y = 4.5, 
		label = "Partisan Cleavage", angle = 270)
dev.off()



data10 <- read.csv("Final Polarization Data 2012.csv")
names(data10)

polryears <- c(data10$Year, data10$Year)
polarization <- c(abs(data10$HRepubMean - data10$HDemMean), 
	abs(data10$SRepubMean - data10$SDemMean))
chamber <- c(rep("House", length(data10$Year)), 
	rep("Senate", length(data10$Year)))
data.polr <- data.frame(polryears, polarization, chamber)
names(data.polr) <- c("Year", "Polarization", "Chamber")

# Figure 2
p <- ggplot(data.polr, aes(x = Year, y = Polarization, group = Chamber))
p + geom_line(aes(lty = Chamber), size = 2) + 
	theme(axis.text.x = element_text(colour="black", size = 13), 
		axis.text.y = element_text(colour="black", size = 13), 
		axis.title.x = element_text(size = 20),
		axis.title.y = element_text(size = 16),
		legend.text = element_text(size = 13), 
		legend.position = "right") +
	ylab("Polarization") + 
	xlab("Year") 
dev.off()




data <- read.csv("CQPolicyTrack.csv")

names(data)
table(data$Issue)
cbind(subset(data$Hyea, data$Issue == "Abortion" & (data$Year < 1985)), 
	subset(data$Hnay, data$Issue == "Abortion" & (data$Year < 1985)))


## ABORTION ##
abort.1960s <- data.frame(subset(data, 
	data$Issue == "Abortion" & data$Year < 1970))
abort.1970s <- data.frame(subset(data, 
	data$Issue == "Abortion" & (data$Year >= 1970 & data$Year <1980)))
abort.1980s <- data.frame(subset(data, 
	data$Issue == "Abortion" & (data$Year >= 1980 & data$Year <1990)))
abort.1990s <- data.frame(subset(data, 
	data$Issue == "Abortion" & (data$Year >= 1990 & data$Year <2000)))
abort.2000s <- data.frame(subset(data, 
	data$Issue == "Abortion" & data$Year >= 2000))

abs.abort.6 <- cbind(mean(abs(abort.1960s$HRyea - abort.1960s$HRnay)/
	(abort.1960s$HRyea + abort.1960s$HRnay), na.rm = T),
	mean(abs(abort.1960s$HDyea - abort.1960s$HDnay)/
	(abort.1960s$HDyea + abort.1960s$HDnay), na.rm = T),
	mean(abs(abort.1960s$SRyea - abort.1960s$SRnay)/
	(abort.1960s$SRyea + abort.1960s$SRnay), na.rm = T),
	mean(abs(abort.1960s$SDyea - abort.1960s$SDnay)/
	(abort.1960s$SDyea + abort.1960s$SDnay), na.rm = T),
	mean(abs((abort.1960s$HRyea - abort.1960s$HRnay)/
	(abort.1960s$HRyea + abort.1960s$HRnay) -
	(abort.1960s$HDyea - abort.1960s$HDnay)/
	(abort.1960s$HDyea + abort.1960s$HDnay)), na.rm = T),
	mean(abs((abort.1960s$SRyea - abort.1960s$SRnay)/
	(abort.1960s$SRyea + abort.1960s$SRnay) -
	(abort.1960s$SDyea - abort.1960s$SDnay)/
	(abort.1960s$SDyea + abort.1960s$SDnay)), na.rm = T))
abs.abort.7 <- cbind(mean(abs(abort.1970s$HRyea - abort.1970s$HRnay)/
	(abort.1970s$HRyea + abort.1970s$HRnay), na.rm = T),
	mean(abs(abort.1970s$HDyea - abort.1970s$HDnay)/
	(abort.1970s$HDyea + abort.1970s$HDnay), na.rm = T),
	mean(abs(abort.1970s$SRyea - abort.1970s$SRnay)/
	(abort.1970s$SRyea + abort.1970s$SRnay), na.rm = T),
	mean(abs(abort.1970s$SDyea - abort.1970s$SDnay)/
	(abort.1970s$SDyea + abort.1970s$SDnay), na.rm = T),
	mean(abs((abort.1970s$HRyea - abort.1970s$HRnay)/
	(abort.1970s$HRyea + abort.1970s$HRnay) -
	(abort.1970s$HDyea - abort.1970s$HDnay)/
	(abort.1970s$HDyea + abort.1970s$HDnay)), na.rm = T),
	mean(abs((abort.1970s$SRyea - abort.1970s$SRnay)/
	(abort.1970s$SRyea + abort.1970s$SRnay) -
	(abort.1970s$SDyea - abort.1970s$SDnay)/
	(abort.1970s$SDyea + abort.1970s$SDnay)), na.rm = T))
abs.abort.8 <- cbind(mean(abs(abort.1980s$HRyea - abort.1980s$HRnay)/
	(abort.1980s$HRyea + abort.1980s$HRnay), na.rm = T),
	mean(abs(abort.1980s$HDyea - abort.1980s$HDnay)/
	(abort.1980s$HDyea + abort.1980s$HDnay), na.rm = T),
	mean(abs(abort.1980s$SRyea - abort.1980s$SRnay)/
	(abort.1980s$SRyea + abort.1980s$SRnay), na.rm = T),
	mean(abs(abort.1980s$SDyea - abort.1980s$SDnay)/
	(abort.1980s$SDyea + abort.1980s$SDnay), na.rm = T),
	mean(abs((abort.1980s$HRyea - abort.1980s$HRnay)/
	(abort.1980s$HRyea + abort.1980s$HRnay) -
	(abort.1980s$HDyea - abort.1980s$HDnay)/
	(abort.1980s$HDyea + abort.1980s$HDnay)), na.rm = T),
	mean(abs((abort.1980s$SRyea - abort.1980s$SRnay)/
	(abort.1980s$SRyea + abort.1980s$SRnay) -
	(abort.1980s$SDyea - abort.1980s$SDnay)/
	(abort.1980s$SDyea + abort.1980s$SDnay)), na.rm = T))
abs.abort.9 <- cbind(mean(abs(abort.1990s$HRyea - abort.1990s$HRnay)/
	(abort.1990s$HRyea + abort.1990s$HRnay), na.rm = T),
	mean(abs(abort.1990s$HDyea - abort.1990s$HDnay)/
	(abort.1990s$HDyea + abort.1990s$HDnay), na.rm = T),
	mean(abs(abort.1990s$SRyea - abort.1990s$SRnay)/
	(abort.1990s$SRyea + abort.1990s$SRnay), na.rm = T),
	mean(abs(abort.1990s$SDyea - abort.1990s$SDnay)/
	(abort.1990s$SDyea + abort.1990s$SDnay), na.rm = T),
	mean(abs((abort.1990s$HRyea - abort.1990s$HRnay)/
	(abort.1990s$HRyea + abort.1990s$HRnay) -
	(abort.1990s$HDyea - abort.1990s$HDnay)/
	(abort.1990s$HDyea + abort.1990s$HDnay)), na.rm = T),
	mean(abs((abort.1990s$SRyea - abort.1990s$SRnay)/
	(abort.1990s$SRyea + abort.1990s$SRnay) -
	(abort.1990s$SDyea - abort.1990s$SDnay)/
	(abort.1990s$SDyea + abort.1990s$SDnay)), na.rm = T))
abs.abort.0 <- cbind(mean(abs(abort.2000s$HRyea - abort.2000s$HRnay)/
	(abort.2000s$HRyea + abort.2000s$HRnay), na.rm = T),
	mean(abs(abort.2000s$HDyea - abort.2000s$HDnay)/
	(abort.2000s$HDyea + abort.2000s$HDnay), na.rm = T),
	mean(abs(abort.2000s$SRyea - abort.2000s$SRnay)/
	(abort.2000s$SRyea + abort.2000s$SRnay), na.rm = T),
	mean(abs(abort.2000s$SDyea - abort.2000s$SDnay)/
	(abort.2000s$SDyea + abort.2000s$SDnay), na.rm = T),
	mean(abs((abort.2000s$HRyea - abort.2000s$HRnay)/
	(abort.2000s$HRyea + abort.2000s$HRnay) -
	(abort.2000s$HDyea - abort.2000s$HDnay)/
	(abort.2000s$HDyea + abort.2000s$HDnay)), na.rm = T),
	mean(abs((abort.2000s$SRyea - abort.2000s$SRnay)/
	(abort.2000s$SRyea + abort.2000s$SRnay) -
	(abort.2000s$SDyea - abort.2000s$SDnay)/
	(abort.2000s$SDyea + abort.2000s$SDnay)), na.rm = T))

abort.pcts <- data.frame(rbind(abs.abort.6, abs.abort.7, 
	abs.abort.8, abs.abort.9, abs.abort.0))
rownames(abort.pcts) <- c("Abort.60s", "Abort.70s", "Abort.80s",
	"Abort.90s", "Abort.00s")

## CLIMATE ##
climate.1960s <- data.frame(subset(data, 
	data$Issue == "Climate" & data$Year < 1970))
climate.1970s <- data.frame(subset(data, 
	data$Issue == "Climate" & (data$Year >= 1970 & data$Year <1980)))
climate.1980s <- data.frame(subset(data, 
	data$Issue == "Climate" & (data$Year >= 1980 & data$Year <1990)))
climate.1990s <- data.frame(subset(data, 
	data$Issue == "Climate" & (data$Year >= 1990 & data$Year <2000)))
climate.2000s <- data.frame(subset(data, 
	data$Issue == "Climate" & data$Year >= 2000))


abs.climate.6 <- cbind(mean(abs(climate.1960s$HRyea - climate.1960s$HRnay)/
	(climate.1960s$HRyea + climate.1960s$HRnay), na.rm = T),
	mean(abs(climate.1960s$HDyea - climate.1960s$HDnay)/
	(climate.1960s$HDyea + climate.1960s$HDnay), na.rm = T),
	mean(abs(climate.1960s$SRyea - climate.1960s$SRnay)/
	(climate.1960s$SRyea + climate.1960s$SRnay), na.rm = T),
	mean(abs(climate.1960s$SDyea - climate.1960s$SDnay)/
	(climate.1960s$SDyea + climate.1960s$SDnay), na.rm = T),
	mean(abs((climate.1960s$HRyea - climate.1960s$HRnay)/
	(climate.1960s$HRyea + climate.1960s$HRnay) -
	(climate.1960s$HDyea - climate.1960s$HDnay)/
	(climate.1960s$HDyea + climate.1960s$HDnay)), na.rm = T),
	mean(abs((climate.1960s$SRyea - climate.1960s$SRnay)/
	(climate.1960s$SRyea + climate.1960s$SRnay) -
	(climate.1960s$SDyea - climate.1960s$SDnay)/
	(climate.1960s$SDyea + climate.1960s$SDnay)), na.rm = T))
abs.climate.7 <- cbind(mean(abs(climate.1970s$HRyea - climate.1970s$HRnay)/
	(climate.1970s$HRyea + climate.1970s$HRnay), na.rm = T),
	mean(abs(climate.1970s$HDyea - climate.1970s$HDnay)/
	(climate.1970s$HDyea + climate.1970s$HDnay), na.rm = T),
	mean(abs(climate.1970s$SRyea - climate.1970s$SRnay)/
	(climate.1970s$SRyea + climate.1970s$SRnay), na.rm = T),
	mean(abs(climate.1970s$SDyea - climate.1970s$SDnay)/
	(climate.1970s$SDyea + climate.1970s$SDnay), na.rm = T),
	mean(abs((climate.1970s$HRyea - climate.1970s$HRnay)/
	(climate.1970s$HRyea + climate.1970s$HRnay) -
	(climate.1970s$HDyea - climate.1970s$HDnay)/
	(climate.1970s$HDyea + climate.1970s$HDnay)), na.rm = T),
	mean(abs((climate.1970s$SRyea - climate.1970s$SRnay)/
	(climate.1970s$SRyea + climate.1970s$SRnay) -
	(climate.1970s$SDyea - climate.1970s$SDnay)/
	(climate.1970s$SDyea + climate.1970s$SDnay)), na.rm = T))
abs.climate.8 <- cbind(mean(abs(climate.1980s$HRyea - climate.1980s$HRnay)/
	(climate.1980s$HRyea + climate.1980s$HRnay), na.rm = T),
	mean(abs(climate.1980s$HDyea - climate.1980s$HDnay)/
	(climate.1980s$HDyea + climate.1980s$HDnay), na.rm = T),
	mean(abs(climate.1980s$SRyea - climate.1980s$SRnay)/
	(climate.1980s$SRyea + climate.1980s$SRnay), na.rm = T),
	mean(abs(climate.1980s$SDyea - climate.1980s$SDnay)/
	(climate.1980s$SDyea + climate.1980s$SDnay), na.rm = T),
	mean(abs((climate.1980s$HRyea - climate.1980s$HRnay)/
	(climate.1980s$HRyea + climate.1980s$HRnay) -
	(climate.1980s$HDyea - climate.1980s$HDnay)/
	(climate.1980s$HDyea + climate.1980s$HDnay)), na.rm = T),
	mean(abs((climate.1980s$SRyea - climate.1980s$SRnay)/
	(climate.1980s$SRyea + climate.1980s$SRnay) -
	(climate.1980s$SDyea - climate.1980s$SDnay)/
	(climate.1980s$SDyea + climate.1980s$SDnay)), na.rm = T))
abs.climate.9 <- cbind(mean(abs(climate.1990s$HRyea - climate.1990s$HRnay)/
	(climate.1990s$HRyea + climate.1990s$HRnay), na.rm = T),
	mean(abs(climate.1990s$HDyea - climate.1990s$HDnay)/
	(climate.1990s$HDyea + climate.1990s$HDnay), na.rm = T),
	mean(abs(climate.1990s$SRyea - climate.1990s$SRnay)/
	(climate.1990s$SRyea + climate.1990s$SRnay), na.rm = T),
	mean(abs(climate.1990s$SDyea - climate.1990s$SDnay)/
	(climate.1990s$SDyea + climate.1990s$SDnay), na.rm = T),
	mean(abs((climate.1990s$HRyea - climate.1990s$HRnay)/
	(climate.1990s$HRyea + climate.1990s$HRnay) -
	(climate.1990s$HDyea - climate.1990s$HDnay)/
	(climate.1990s$HDyea + climate.1990s$HDnay)), na.rm = T),
	mean(abs((climate.1990s$SRyea - climate.1990s$SRnay)/
	(climate.1990s$SRyea + climate.1990s$SRnay) -
	(climate.1990s$SDyea - climate.1990s$SDnay)/
	(climate.1990s$SDyea + climate.1990s$SDnay)), na.rm = T))
abs.climate.0 <- cbind(mean(abs(climate.2000s$HRyea - climate.2000s$HRnay)/
	(climate.2000s$HRyea + climate.2000s$HRnay), na.rm = T),
	mean(abs(climate.2000s$HDyea - climate.2000s$HDnay)/
	(climate.2000s$HDyea + climate.2000s$HDnay), na.rm = T),
	mean(abs(climate.2000s$SRyea - climate.2000s$SRnay)/
	(climate.2000s$SRyea + climate.2000s$SRnay), na.rm = T),
	mean(abs(climate.2000s$SDyea - climate.2000s$SDnay)/
	(climate.2000s$SDyea + climate.2000s$SDnay), na.rm = T),
	mean(abs((climate.2000s$HRyea - climate.2000s$HRnay)/
	(climate.2000s$HRyea + climate.2000s$HRnay) -
	(climate.2000s$HDyea - climate.2000s$HDnay)/
	(climate.2000s$HDyea + climate.2000s$HDnay)), na.rm = T),
	mean(abs((climate.2000s$SRyea - climate.2000s$SRnay)/
	(climate.2000s$SRyea + climate.2000s$SRnay) -
	(climate.2000s$SDyea - climate.2000s$SDnay)/
	(climate.2000s$SDyea + climate.2000s$SDnay)), na.rm = T))

climate.pcts <- data.frame(rbind(abs.climate.6, abs.climate.7, 
	abs.climate.8, abs.climate.9, abs.climate.0))
rownames(climate.pcts) <- c("Climate.60s", "Climate.70s", "Climate.80s",
	"Climate.90s", "Climate.00s")


## DEATH ##
death.1960s <- data.frame(subset(data, 
	data$Issue == "Death" & data$Year < 1970))
death.1970s <- data.frame(subset(data, 
	data$Issue == "Death" & (data$Year >= 1970 & data$Year <1980)))
death.1980s <- data.frame(subset(data, 
	data$Issue == "Death" & (data$Year >= 1980 & data$Year <1990)))
death.1990s <- data.frame(subset(data, 
	data$Issue == "Death" & (data$Year >= 1990 & data$Year <2000)))
death.2000s <- data.frame(subset(data, 
	data$Issue == "Death" & data$Year >= 2000))

abs.death.6 <- cbind(mean(abs(death.1960s$HRyea - death.1960s$HRnay)/
	(death.1960s$HRyea + death.1960s$HRnay), na.rm = T),
	mean(abs(death.1960s$HDyea - death.1960s$HDnay)/
	(death.1960s$HDyea + death.1960s$HDnay), na.rm = T),
	mean(abs(death.1960s$SRyea - death.1960s$SRnay)/
	(death.1960s$SRyea + death.1960s$SRnay), na.rm = T),
	mean(abs(death.1960s$SDyea - death.1960s$SDnay)/
	(death.1960s$SDyea + death.1960s$SDnay), na.rm = T),
	mean(abs((death.1960s$HRyea - death.1960s$HRnay)/
	(death.1960s$HRyea + death.1960s$HRnay) -
	(death.1960s$HDyea - death.1960s$HDnay)/
	(death.1960s$HDyea + death.1960s$HDnay)), na.rm = T),
	mean(abs((death.1960s$SRyea - death.1960s$SRnay)/
	(death.1960s$SRyea + death.1960s$SRnay) -
	(death.1960s$SDyea - death.1960s$SDnay)/
	(death.1960s$SDyea + death.1960s$SDnay)), na.rm = T))
abs.death.7 <- cbind(mean(abs(death.1970s$HRyea - death.1970s$HRnay)/
	(death.1970s$HRyea + death.1970s$HRnay), na.rm = T),
	mean(abs(death.1970s$HDyea - death.1970s$HDnay)/
	(death.1970s$HDyea + death.1970s$HDnay), na.rm = T),
	mean(abs(death.1970s$SRyea - death.1970s$SRnay)/
	(death.1970s$SRyea + death.1970s$SRnay), na.rm = T),
	mean(abs(death.1970s$SDyea - death.1970s$SDnay)/
	(death.1970s$SDyea + death.1970s$SDnay), na.rm = T),
	mean(abs((death.1970s$HRyea - death.1970s$HRnay)/
	(death.1970s$HRyea + death.1970s$HRnay) -
	(death.1970s$HDyea - death.1970s$HDnay)/
	(death.1970s$HDyea + death.1970s$HDnay)), na.rm = T),
	mean(abs((death.1970s$SRyea - death.1970s$SRnay)/
	(death.1970s$SRyea + death.1970s$SRnay) -
	(death.1970s$SDyea - death.1970s$SDnay)/
	(death.1970s$SDyea + death.1970s$SDnay)), na.rm = T))
abs.death.8 <- cbind(mean(abs(death.1980s$HRyea - death.1980s$HRnay)/
	(death.1980s$HRyea + death.1980s$HRnay), na.rm = T),
	mean(abs(death.1980s$HDyea - death.1980s$HDnay)/
	(death.1980s$HDyea + death.1980s$HDnay), na.rm = T),
	mean(abs(death.1980s$SRyea - death.1980s$SRnay)/
	(death.1980s$SRyea + death.1980s$SRnay), na.rm = T),
	mean(abs(death.1980s$SDyea - death.1980s$SDnay)/
	(death.1980s$SDyea + death.1980s$SDnay), na.rm = T),
	mean(abs((death.1980s$HRyea - death.1980s$HRnay)/
	(death.1980s$HRyea + death.1980s$HRnay) -
	(death.1980s$HDyea - death.1980s$HDnay)/
	(death.1980s$HDyea + death.1980s$HDnay)), na.rm = T),
	mean(abs((death.1980s$SRyea - death.1980s$SRnay)/
	(death.1980s$SRyea + death.1980s$SRnay) -
	(death.1980s$SDyea - death.1980s$SDnay)/
	(death.1980s$SDyea + death.1980s$SDnay)), na.rm = T))
abs.death.9 <- cbind(mean(abs(death.1990s$HRyea - death.1990s$HRnay)/
	(death.1990s$HRyea + death.1990s$HRnay), na.rm = T),
	mean(abs(death.1990s$HDyea - death.1990s$HDnay)/
	(death.1990s$HDyea + death.1990s$HDnay), na.rm = T),
	mean(abs(death.1990s$SRyea - death.1990s$SRnay)/
	(death.1990s$SRyea + death.1990s$SRnay), na.rm = T),
	mean(abs(death.1990s$SDyea - death.1990s$SDnay)/
	(death.1990s$SDyea + death.1990s$SDnay), na.rm = T),
	mean(abs((death.1990s$HRyea - death.1990s$HRnay)/
	(death.1990s$HRyea + death.1990s$HRnay) -
	(death.1990s$HDyea - death.1990s$HDnay)/
	(death.1990s$HDyea + death.1990s$HDnay)), na.rm = T),
	mean(abs((death.1990s$SRyea - death.1990s$SRnay)/
	(death.1990s$SRyea + death.1990s$SRnay) -
	(death.1990s$SDyea - death.1990s$SDnay)/
	(death.1990s$SDyea + death.1990s$SDnay)), na.rm = T))
abs.death.0 <- cbind(mean(abs(death.2000s$HRyea - death.2000s$HRnay)/
	(death.2000s$HRyea + death.2000s$HRnay), na.rm = T),
	mean(abs(death.2000s$HDyea - death.2000s$HDnay)/
	(death.2000s$HDyea + death.2000s$HDnay), na.rm = T),
	mean(abs(death.2000s$SRyea - death.2000s$SRnay)/
	(death.2000s$SRyea + death.2000s$SRnay), na.rm = T),
	mean(abs(death.2000s$SDyea - death.2000s$SDnay)/
	(death.2000s$SDyea + death.2000s$SDnay), na.rm = T),
	mean(abs((death.2000s$HRyea - death.2000s$HRnay)/
	(death.2000s$HRyea + death.2000s$HRnay) -
	(death.2000s$HDyea - death.2000s$HDnay)/
	(death.2000s$HDyea + death.2000s$HDnay)), na.rm = T),
	mean(abs((death.2000s$SRyea - death.2000s$SRnay)/
	(death.2000s$SRyea + death.2000s$SRnay) -
	(death.2000s$SDyea - death.2000s$SDnay)/
	(death.2000s$SDyea + death.2000s$SDnay)), na.rm = T))

death.pcts <- data.frame(rbind(abs.death.6, abs.death.7, 
	abs.death.8, abs.death.9, abs.death.0))
rownames(death.pcts) <- c("Death.60s", "Death.70s", "Death.80s",
	"Death.90s", "Death.00s")



## GUNS ##
guns.1960s <- data.frame(subset(data, 
	data$Issue == "Guns" & data$Year < 1970))
guns.1970s <- data.frame(subset(data, 
	data$Issue == "Guns" & (data$Year >= 1970 & data$Year <1980)))
guns.1980s <- data.frame(subset(data, 
	data$Issue == "Guns" & (data$Year >= 1980 & data$Year <1990)))
guns.1990s <- data.frame(subset(data, 
	data$Issue == "Guns" & (data$Year >= 1990 & data$Year <2000)))
guns.2000s <- data.frame(subset(data, 
	data$Issue == "Guns" & data$Year >= 2000))

abs.guns.6 <- cbind(mean(abs(guns.1960s$HRyea - guns.1960s$HRnay)/
	(guns.1960s$HRyea + guns.1960s$HRnay), na.rm = T),
	mean(abs(guns.1960s$HDyea - guns.1960s$HDnay)/
	(guns.1960s$HDyea + guns.1960s$HDnay), na.rm = T),
	mean(abs(guns.1960s$SRyea - guns.1960s$SRnay)/
	(guns.1960s$SRyea + guns.1960s$SRnay), na.rm = T),
	mean(abs(guns.1960s$SDyea - guns.1960s$SDnay)/
	(guns.1960s$SDyea + guns.1960s$SDnay), na.rm = T),
	mean(abs((guns.1960s$HRyea - guns.1960s$HRnay)/
	(guns.1960s$HRyea + guns.1960s$HRnay) -
	(guns.1960s$HDyea - guns.1960s$HDnay)/
	(guns.1960s$HDyea + guns.1960s$HDnay)), na.rm = T),
	mean(abs((guns.1960s$SRyea - guns.1960s$SRnay)/
	(guns.1960s$SRyea + guns.1960s$SRnay) -
	(guns.1960s$SDyea - guns.1960s$SDnay)/
	(guns.1960s$SDyea + guns.1960s$SDnay)), na.rm = T))
abs.guns.7 <- cbind(mean(abs(guns.1970s$HRyea - guns.1970s$HRnay)/
	(guns.1970s$HRyea + guns.1970s$HRnay), na.rm = T),
	mean(abs(guns.1970s$HDyea - guns.1970s$HDnay)/
	(guns.1970s$HDyea + guns.1970s$HDnay), na.rm = T),
	mean(abs(guns.1970s$SRyea - guns.1970s$SRnay)/
	(guns.1970s$SRyea + guns.1970s$SRnay), na.rm = T),
	mean(abs(guns.1970s$SDyea - guns.1970s$SDnay)/
	(guns.1970s$SDyea + guns.1970s$SDnay), na.rm = T),
	mean(abs((guns.1970s$HRyea - guns.1970s$HRnay)/
	(guns.1970s$HRyea + guns.1970s$HRnay) -
	(guns.1970s$HDyea - guns.1970s$HDnay)/
	(guns.1970s$HDyea + guns.1970s$HDnay)), na.rm = T),
	mean(abs((guns.1970s$SRyea - guns.1970s$SRnay)/
	(guns.1970s$SRyea + guns.1970s$SRnay) -
	(guns.1970s$SDyea - guns.1970s$SDnay)/
	(guns.1970s$SDyea + guns.1970s$SDnay)), na.rm = T))
abs.guns.8 <- cbind(mean(abs(guns.1980s$HRyea - guns.1980s$HRnay)/
	(guns.1980s$HRyea + guns.1980s$HRnay), na.rm = T),
	mean(abs(guns.1980s$HDyea - guns.1980s$HDnay)/
	(guns.1980s$HDyea + guns.1980s$HDnay), na.rm = T),
	mean(abs(guns.1980s$SRyea - guns.1980s$SRnay)/
	(guns.1980s$SRyea + guns.1980s$SRnay), na.rm = T),
	mean(abs(guns.1980s$SDyea - guns.1980s$SDnay)/
	(guns.1980s$SDyea + guns.1980s$SDnay), na.rm = T),
	mean(abs((guns.1980s$HRyea - guns.1980s$HRnay)/
	(guns.1980s$HRyea + guns.1980s$HRnay) -
	(guns.1980s$HDyea - guns.1980s$HDnay)/
	(guns.1980s$HDyea + guns.1980s$HDnay)), na.rm = T),
	mean(abs((guns.1980s$SRyea - guns.1980s$SRnay)/
	(guns.1980s$SRyea + guns.1980s$SRnay) -
	(guns.1980s$SDyea - guns.1980s$SDnay)/
	(guns.1980s$SDyea + guns.1980s$SDnay)), na.rm = T))
abs.guns.9 <- cbind(mean(abs(guns.1990s$HRyea - guns.1990s$HRnay)/
	(guns.1990s$HRyea + guns.1990s$HRnay), na.rm = T),
	mean(abs(guns.1990s$HDyea - guns.1990s$HDnay)/
	(guns.1990s$HDyea + guns.1990s$HDnay), na.rm = T),
	mean(abs(guns.1990s$SRyea - guns.1990s$SRnay)/
	(guns.1990s$SRyea + guns.1990s$SRnay), na.rm = T),
	mean(abs(guns.1990s$SDyea - guns.1990s$SDnay)/
	(guns.1990s$SDyea + guns.1990s$SDnay), na.rm = T),
	mean(abs((guns.1990s$HRyea - guns.1990s$HRnay)/
	(guns.1990s$HRyea + guns.1990s$HRnay) -
	(guns.1990s$HDyea - guns.1990s$HDnay)/
	(guns.1990s$HDyea + guns.1990s$HDnay)), na.rm = T),
	mean(abs((guns.1990s$SRyea - guns.1990s$SRnay)/
	(guns.1990s$SRyea + guns.1990s$SRnay) -
	(guns.1990s$SDyea - guns.1990s$SDnay)/
	(guns.1990s$SDyea + guns.1990s$SDnay)), na.rm = T))
abs.guns.0 <- cbind(mean(abs(guns.2000s$HRyea - guns.2000s$HRnay)/
	(guns.2000s$HRyea + guns.2000s$HRnay), na.rm = T),
	mean(abs(guns.2000s$HDyea - guns.2000s$HDnay)/
	(guns.2000s$HDyea + guns.2000s$HDnay), na.rm = T),
	mean(abs(guns.2000s$SRyea - guns.2000s$SRnay)/
	(guns.2000s$SRyea + guns.2000s$SRnay), na.rm = T),
	mean(abs(guns.2000s$SDyea - guns.2000s$SDnay)/
	(guns.2000s$SDyea + guns.2000s$SDnay), na.rm = T),
	mean(abs((guns.2000s$HRyea - guns.2000s$HRnay)/
	(guns.2000s$HRyea + guns.2000s$HRnay) -
	(guns.2000s$HDyea - guns.2000s$HDnay)/
	(guns.2000s$HDyea + guns.2000s$HDnay)), na.rm = T),
	mean(abs((guns.2000s$SRyea - guns.2000s$SRnay)/
	(guns.2000s$SRyea + guns.2000s$SRnay) -
	(guns.2000s$SDyea - guns.2000s$SDnay)/
	(guns.2000s$SDyea + guns.2000s$SDnay)), na.rm = T))

guns.pcts <- data.frame(rbind(abs.guns.6, abs.guns.7, 
	abs.guns.8, abs.guns.9, abs.guns.0))
rownames(guns.pcts) <- c("Guns.60s", "Guns.70s", "Guns.80s",
	"Guns.90s", "Guns.00s")



## LURID ##
lurid.1960s <- data.frame(subset(data, 
	data$Issue == "Lurid" & data$Year < 1970))
lurid.1970s <- data.frame(subset(data, 
	data$Issue == "Lurid" & (data$Year >= 1970 & data$Year <1980)))
lurid.1980s <- data.frame(subset(data, 
	data$Issue == "Lurid" & (data$Year >= 1980 & data$Year <1990)))
lurid.1990s <- data.frame(subset(data, 
	data$Issue == "Lurid" & (data$Year >= 1990 & data$Year <2000)))
lurid.2000s <- data.frame(subset(data, 
	data$Issue == "Lurid" & data$Year >= 2000))

abs.lurid.6 <- cbind(mean(abs(lurid.1960s$HRyea - lurid.1960s$HRnay)/
	(lurid.1960s$HRyea + lurid.1960s$HRnay), na.rm = T),
	mean(abs(lurid.1960s$HDyea - lurid.1960s$HDnay)/
	(lurid.1960s$HDyea + lurid.1960s$HDnay), na.rm = T),
	mean(abs(lurid.1960s$SRyea - lurid.1960s$SRnay)/
	(lurid.1960s$SRyea + lurid.1960s$SRnay), na.rm = T),
	mean(abs(lurid.1960s$SDyea - lurid.1960s$SDnay)/
	(lurid.1960s$SDyea + lurid.1960s$SDnay), na.rm = T),
	mean(abs((lurid.1960s$HRyea - lurid.1960s$HRnay)/
	(lurid.1960s$HRyea + lurid.1960s$HRnay) -
	(lurid.1960s$HDyea - lurid.1960s$HDnay)/
	(lurid.1960s$HDyea + lurid.1960s$HDnay)), na.rm = T),
	mean(abs((lurid.1960s$SRyea - lurid.1960s$SRnay)/
	(lurid.1960s$SRyea + lurid.1960s$SRnay) -
	(lurid.1960s$SDyea - lurid.1960s$SDnay)/
	(lurid.1960s$SDyea + lurid.1960s$SDnay)), na.rm = T))
abs.lurid.7 <- cbind(mean(abs(lurid.1970s$HRyea - lurid.1970s$HRnay)/
	(lurid.1970s$HRyea + lurid.1970s$HRnay), na.rm = T),
	mean(abs(lurid.1970s$HDyea - lurid.1970s$HDnay)/
	(lurid.1970s$HDyea + lurid.1970s$HDnay), na.rm = T),
	mean(abs(lurid.1970s$SRyea - lurid.1970s$SRnay)/
	(lurid.1970s$SRyea + lurid.1970s$SRnay), na.rm = T),
	mean(abs(lurid.1970s$SDyea - lurid.1970s$SDnay)/
	(lurid.1970s$SDyea + lurid.1970s$SDnay), na.rm = T),
	mean(abs((lurid.1970s$HRyea - lurid.1970s$HRnay)/
	(lurid.1970s$HRyea + lurid.1970s$HRnay) -
	(lurid.1970s$HDyea - lurid.1970s$HDnay)/
	(lurid.1970s$HDyea + lurid.1970s$HDnay)), na.rm = T),
	mean(abs((lurid.1970s$SRyea - lurid.1970s$SRnay)/
	(lurid.1970s$SRyea + lurid.1970s$SRnay) -
	(lurid.1970s$SDyea - lurid.1970s$SDnay)/
	(lurid.1970s$SDyea + lurid.1970s$SDnay)), na.rm = T))
abs.lurid.8 <- cbind(mean(abs(lurid.1980s$HRyea - lurid.1980s$HRnay)/
	(lurid.1980s$HRyea + lurid.1980s$HRnay), na.rm = T),
	mean(abs(lurid.1980s$HDyea - lurid.1980s$HDnay)/
	(lurid.1980s$HDyea + lurid.1980s$HDnay), na.rm = T),
	mean(abs(lurid.1980s$SRyea - lurid.1980s$SRnay)/
	(lurid.1980s$SRyea + lurid.1980s$SRnay), na.rm = T),
	mean(abs(lurid.1980s$SDyea - lurid.1980s$SDnay)/
	(lurid.1980s$SDyea + lurid.1980s$SDnay), na.rm = T),
	mean(abs((lurid.1980s$HRyea - lurid.1980s$HRnay)/
	(lurid.1980s$HRyea + lurid.1980s$HRnay) -
	(lurid.1980s$HDyea - lurid.1980s$HDnay)/
	(lurid.1980s$HDyea + lurid.1980s$HDnay)), na.rm = T),
	mean(abs((lurid.1980s$SRyea - lurid.1980s$SRnay)/
	(lurid.1980s$SRyea + lurid.1980s$SRnay) -
	(lurid.1980s$SDyea - lurid.1980s$SDnay)/
	(lurid.1980s$SDyea + lurid.1980s$SDnay)), na.rm = T))
abs.lurid.9 <- cbind(mean(abs(lurid.1990s$HRyea - lurid.1990s$HRnay)/
	(lurid.1990s$HRyea + lurid.1990s$HRnay), na.rm = T),
	mean(abs(lurid.1990s$HDyea - lurid.1990s$HDnay)/
	(lurid.1990s$HDyea + lurid.1990s$HDnay), na.rm = T),
	mean(abs(lurid.1990s$SRyea - lurid.1990s$SRnay)/
	(lurid.1990s$SRyea + lurid.1990s$SRnay), na.rm = T),
	mean(abs(lurid.1990s$SDyea - lurid.1990s$SDnay)/
	(lurid.1990s$SDyea + lurid.1990s$SDnay), na.rm = T),
	mean(abs((lurid.1990s$HRyea - lurid.1990s$HRnay)/
	(lurid.1990s$HRyea + lurid.1990s$HRnay) -
	(lurid.1990s$HDyea - lurid.1990s$HDnay)/
	(lurid.1990s$HDyea + lurid.1990s$HDnay)), na.rm = T),
	mean(abs((lurid.1990s$SRyea - lurid.1990s$SRnay)/
	(lurid.1990s$SRyea + lurid.1990s$SRnay) -
	(lurid.1990s$SDyea - lurid.1990s$SDnay)/
	(lurid.1990s$SDyea + lurid.1990s$SDnay)), na.rm = T))
abs.lurid.0 <- cbind(mean(abs(lurid.2000s$HRyea - lurid.2000s$HRnay)/
	(lurid.2000s$HRyea + lurid.2000s$HRnay), na.rm = T),
	mean(abs(lurid.2000s$HDyea - lurid.2000s$HDnay)/
	(lurid.2000s$HDyea + lurid.2000s$HDnay), na.rm = T),
	mean(abs(lurid.2000s$SRyea - lurid.2000s$SRnay)/
	(lurid.2000s$SRyea + lurid.2000s$SRnay), na.rm = T),
	mean(abs(lurid.2000s$SDyea - lurid.2000s$SDnay)/
	(lurid.2000s$SDyea + lurid.2000s$SDnay), na.rm = T),
	mean(abs((lurid.2000s$HRyea - lurid.2000s$HRnay)/
	(lurid.2000s$HRyea + lurid.2000s$HRnay) -
	(lurid.2000s$HDyea - lurid.2000s$HDnay)/
	(lurid.2000s$HDyea + lurid.2000s$HDnay)), na.rm = T),
	mean(abs((lurid.2000s$SRyea - lurid.2000s$SRnay)/
	(lurid.2000s$SRyea + lurid.2000s$SRnay) -
	(lurid.2000s$SDyea - lurid.2000s$SDnay)/
	(lurid.2000s$SDyea + lurid.2000s$SDnay)), na.rm = T))

lurid.pcts <- data.frame(rbind(abs.lurid.6, abs.lurid.7, 
	abs.lurid.8, abs.lurid.9, abs.lurid.0))
rownames(lurid.pcts) <- c("Lurid.60s", "Lurid.70s", "Lurid.80s",
	"Lurid.90s", "Lurid.00s")



## POST OFFICE ##
post.1960s <- data.frame(subset(data, 
	data$Issue == "Post" & data$Year < 1970))
post.1970s <- data.frame(subset(data, 
	data$Issue == "Post" & (data$Year >= 1970 & data$Year <1980)))
post.1980s <- data.frame(subset(data, 
	data$Issue == "Post" & (data$Year >= 1980 & data$Year <1990)))
post.1990s <- data.frame(subset(data, 
	data$Issue == "Post" & (data$Year >= 1990 & data$Year <2000)))
post.2000s <- data.frame(subset(data, 
	data$Issue == "Post" & data$Year >= 2000))

abs.post.6 <- cbind(mean(abs(post.1960s$HRyea - post.1960s$HRnay)/
	(post.1960s$HRyea + post.1960s$HRnay), na.rm = T),
	mean(abs(post.1960s$HDyea - post.1960s$HDnay)/
	(post.1960s$HDyea + post.1960s$HDnay), na.rm = T),
	mean(abs(post.1960s$SRyea - post.1960s$SRnay)/
	(post.1960s$SRyea + post.1960s$SRnay), na.rm = T),
	mean(abs(post.1960s$SDyea - post.1960s$SDnay)/
	(post.1960s$SDyea + post.1960s$SDnay), na.rm = T),
	mean(abs((post.1960s$HRyea - post.1960s$HRnay)/
	(post.1960s$HRyea + post.1960s$HRnay) -
	(post.1960s$HDyea - post.1960s$HDnay)/
	(post.1960s$HDyea + post.1960s$HDnay)), na.rm = T),
	mean(abs((post.1960s$SRyea - post.1960s$SRnay)/
	(post.1960s$SRyea + post.1960s$SRnay) -
	(post.1960s$SDyea - post.1960s$SDnay)/
	(post.1960s$SDyea + post.1960s$SDnay)), na.rm = T))
abs.post.7 <- cbind(mean(abs(post.1970s$HRyea - post.1970s$HRnay)/
	(post.1970s$HRyea + post.1970s$HRnay), na.rm = T),
	mean(abs(post.1970s$HDyea - post.1970s$HDnay)/
	(post.1970s$HDyea + post.1970s$HDnay), na.rm = T),
	mean(abs(post.1970s$SRyea - post.1970s$SRnay)/
	(post.1970s$SRyea + post.1970s$SRnay), na.rm = T),
	mean(abs(post.1970s$SDyea - post.1970s$SDnay)/
	(post.1970s$SDyea + post.1970s$SDnay), na.rm = T),
	mean(abs((post.1970s$HRyea - post.1970s$HRnay)/
	(post.1970s$HRyea + post.1970s$HRnay) -
	(post.1970s$HDyea - post.1970s$HDnay)/
	(post.1970s$HDyea + post.1970s$HDnay)), na.rm = T),
	mean(abs((post.1970s$SRyea - post.1970s$SRnay)/
	(post.1970s$SRyea + post.1970s$SRnay) -
	(post.1970s$SDyea - post.1970s$SDnay)/
	(post.1970s$SDyea + post.1970s$SDnay)), na.rm = T))
abs.post.8 <- cbind(mean(abs(post.1980s$HRyea - post.1980s$HRnay)/
	(post.1980s$HRyea + post.1980s$HRnay), na.rm = T),
	mean(abs(post.1980s$HDyea - post.1980s$HDnay)/
	(post.1980s$HDyea + post.1980s$HDnay), na.rm = T),
	mean(abs(post.1980s$SRyea - post.1980s$SRnay)/
	(post.1980s$SRyea + post.1980s$SRnay), na.rm = T),
	mean(abs(post.1980s$SDyea - post.1980s$SDnay)/
	(post.1980s$SDyea + post.1980s$SDnay), na.rm = T),
	mean(abs((post.1980s$HRyea - post.1980s$HRnay)/
	(post.1980s$HRyea + post.1980s$HRnay) -
	(post.1980s$HDyea - post.1980s$HDnay)/
	(post.1980s$HDyea + post.1980s$HDnay)), na.rm = T),
	mean(abs((post.1980s$SRyea - post.1980s$SRnay)/
	(post.1980s$SRyea + post.1980s$SRnay) -
	(post.1980s$SDyea - post.1980s$SDnay)/
	(post.1980s$SDyea + post.1980s$SDnay)), na.rm = T))
abs.post.9 <- cbind(mean(abs(post.1990s$HRyea - post.1990s$HRnay)/
	(post.1990s$HRyea + post.1990s$HRnay), na.rm = T),
	mean(abs(post.1990s$HDyea - post.1990s$HDnay)/
	(post.1990s$HDyea + post.1990s$HDnay), na.rm = T),
	mean(abs(post.1990s$SRyea - post.1990s$SRnay)/
	(post.1990s$SRyea + post.1990s$SRnay), na.rm = T),
	mean(abs(post.1990s$SDyea - post.1990s$SDnay)/
	(post.1990s$SDyea + post.1990s$SDnay), na.rm = T),
	mean(abs((post.1990s$HRyea - post.1990s$HRnay)/
	(post.1990s$HRyea + post.1990s$HRnay) -
	(post.1990s$HDyea - post.1990s$HDnay)/
	(post.1990s$HDyea + post.1990s$HDnay)), na.rm = T),
	mean(abs((post.1990s$SRyea - post.1990s$SRnay)/
	(post.1990s$SRyea + post.1990s$SRnay) -
	(post.1990s$SDyea - post.1990s$SDnay)/
	(post.1990s$SDyea + post.1990s$SDnay)), na.rm = T))
abs.post.0 <- cbind(mean(abs(post.2000s$HRyea - post.2000s$HRnay)/
	(post.2000s$HRyea + post.2000s$HRnay), na.rm = T),
	mean(abs(post.2000s$HDyea - post.2000s$HDnay)/
	(post.2000s$HDyea + post.2000s$HDnay), na.rm = T),
	mean(abs(post.2000s$SRyea - post.2000s$SRnay)/
	(post.2000s$SRyea + post.2000s$SRnay), na.rm = T),
	mean(abs(post.2000s$SDyea - post.2000s$SDnay)/
	(post.2000s$SDyea + post.2000s$SDnay), na.rm = T),
	mean(abs((post.2000s$HRyea - post.2000s$HRnay)/
	(post.2000s$HRyea + post.2000s$HRnay) -
	(post.2000s$HDyea - post.2000s$HDnay)/
	(post.2000s$HDyea + post.2000s$HDnay)), na.rm = T),
	mean(abs((post.2000s$SRyea - post.2000s$SRnay)/
	(post.2000s$SRyea + post.2000s$SRnay) -
	(post.2000s$SDyea - post.2000s$SDnay)/
	(post.2000s$SDyea + post.2000s$SDnay)), na.rm = T))

post.pcts <- data.frame(rbind(abs.post.6, abs.post.7, 
	abs.post.8, abs.post.9, abs.post.0))
rownames(post.pcts) <- c("Post.60s", "Post.70s", "Post.80s",
	"Post.90s", "Post.00s")


## MINIMUM WAGE ##
mw.1960s <- data.frame(subset(data, 
	data$Issue == "Wage" & data$Year < 1970))
mw.1970s <- data.frame(subset(data, 
	data$Issue == "Wage" & (data$Year >= 1970 & data$Year <1980)))
mw.1980s <- data.frame(subset(data, 
	data$Issue == "Wage" & (data$Year >= 1980 & data$Year <1990)))
mw.1990s <- data.frame(subset(data, 
	data$Issue == "Wage" & (data$Year >= 1990 & data$Year <2000)))
mw.2000s <- data.frame(subset(data, 
	data$Issue == "Wage" & data$Year >= 2000))

abs.mw.6 <- cbind(mean(abs(mw.1960s$HRyea - mw.1960s$HRnay)/
	(mw.1960s$HRyea + mw.1960s$HRnay), na.rm = T),
	mean(abs(mw.1960s$HDyea - mw.1960s$HDnay)/
	(mw.1960s$HDyea + mw.1960s$HDnay), na.rm = T),
	mean(abs(mw.1960s$SRyea - mw.1960s$SRnay)/
	(mw.1960s$SRyea + mw.1960s$SRnay), na.rm = T),
	mean(abs(mw.1960s$SDyea - mw.1960s$SDnay)/
	(mw.1960s$SDyea + mw.1960s$SDnay), na.rm = T),
	mean(abs((mw.1960s$HRyea - mw.1960s$HRnay)/
	(mw.1960s$HRyea + mw.1960s$HRnay) -
	(mw.1960s$HDyea - mw.1960s$HDnay)/
	(mw.1960s$HDyea + mw.1960s$HDnay)), na.rm = T),
	mean(abs((mw.1960s$SRyea - mw.1960s$SRnay)/
	(mw.1960s$SRyea + mw.1960s$SRnay) -
	(mw.1960s$SDyea - mw.1960s$SDnay)/
	(mw.1960s$SDyea + mw.1960s$SDnay)), na.rm = T))
abs.mw.7 <- cbind(mean(abs(mw.1970s$HRyea - mw.1970s$HRnay)/
	(mw.1970s$HRyea + mw.1970s$HRnay), na.rm = T),
	mean(abs(mw.1970s$HDyea - mw.1970s$HDnay)/
	(mw.1970s$HDyea + mw.1970s$HDnay), na.rm = T),
	mean(abs(mw.1970s$SRyea - mw.1970s$SRnay)/
	(mw.1970s$SRyea + mw.1970s$SRnay), na.rm = T),
	mean(abs(mw.1970s$SDyea - mw.1970s$SDnay)/
	(mw.1970s$SDyea + mw.1970s$SDnay), na.rm = T),
	mean(abs((mw.1970s$HRyea - mw.1970s$HRnay)/
	(mw.1970s$HRyea + mw.1970s$HRnay) -
	(mw.1970s$HDyea - mw.1970s$HDnay)/
	(mw.1970s$HDyea + mw.1970s$HDnay)), na.rm = T),
	mean(abs((mw.1970s$SRyea - mw.1970s$SRnay)/
	(mw.1970s$SRyea + mw.1970s$SRnay) -
	(mw.1970s$SDyea - mw.1970s$SDnay)/
	(mw.1970s$SDyea + mw.1970s$SDnay)), na.rm = T))
abs.mw.8 <- cbind(mean(abs(mw.1980s$HRyea - mw.1980s$HRnay)/
	(mw.1980s$HRyea + mw.1980s$HRnay), na.rm = T),
	mean(abs(mw.1980s$HDyea - mw.1980s$HDnay)/
	(mw.1980s$HDyea + mw.1980s$HDnay), na.rm = T),
	mean(abs(mw.1980s$SRyea - mw.1980s$SRnay)/
	(mw.1980s$SRyea + mw.1980s$SRnay), na.rm = T),
	mean(abs(mw.1980s$SDyea - mw.1980s$SDnay)/
	(mw.1980s$SDyea + mw.1980s$SDnay), na.rm = T),
	mean(abs((mw.1980s$HRyea - mw.1980s$HRnay)/
	(mw.1980s$HRyea + mw.1980s$HRnay) -
	(mw.1980s$HDyea - mw.1980s$HDnay)/
	(mw.1980s$HDyea + mw.1980s$HDnay)), na.rm = T),
	mean(abs((mw.1980s$SRyea - mw.1980s$SRnay)/
	(mw.1980s$SRyea + mw.1980s$SRnay) -
	(mw.1980s$SDyea - mw.1980s$SDnay)/
	(mw.1980s$SDyea + mw.1980s$SDnay)), na.rm = T))
abs.mw.9 <- cbind(mean(abs(mw.1990s$HRyea - mw.1990s$HRnay)/
	(mw.1990s$HRyea + mw.1990s$HRnay), na.rm = T),
	mean(abs(mw.1990s$HDyea - mw.1990s$HDnay)/
	(mw.1990s$HDyea + mw.1990s$HDnay), na.rm = T),
	mean(abs(mw.1990s$SRyea - mw.1990s$SRnay)/
	(mw.1990s$SRyea + mw.1990s$SRnay), na.rm = T),
	mean(abs(mw.1990s$SDyea - mw.1990s$SDnay)/
	(mw.1990s$SDyea + mw.1990s$SDnay), na.rm = T),
	mean(abs((mw.1990s$HRyea - mw.1990s$HRnay)/
	(mw.1990s$HRyea + mw.1990s$HRnay) -
	(mw.1990s$HDyea - mw.1990s$HDnay)/
	(mw.1990s$HDyea + mw.1990s$HDnay)), na.rm = T),
	mean(abs((mw.1990s$SRyea - mw.1990s$SRnay)/
	(mw.1990s$SRyea + mw.1990s$SRnay) -
	(mw.1990s$SDyea - mw.1990s$SDnay)/
	(mw.1990s$SDyea + mw.1990s$SDnay)), na.rm = T))
abs.mw.0 <- cbind(mean(abs(mw.2000s$HRyea - mw.2000s$HRnay)/
	(mw.2000s$HRyea + mw.2000s$HRnay), na.rm = T),
	mean(abs(mw.2000s$HDyea - mw.2000s$HDnay)/
	(mw.2000s$HDyea + mw.2000s$HDnay), na.rm = T),
	mean(abs(mw.2000s$SRyea - mw.2000s$SRnay)/
	(mw.2000s$SRyea + mw.2000s$SRnay), na.rm = T),
	mean(abs(mw.2000s$SDyea - mw.2000s$SDnay)/
	(mw.2000s$SDyea + mw.2000s$SDnay), na.rm = T),
	mean(abs((mw.2000s$HRyea - mw.2000s$HRnay)/
	(mw.2000s$HRyea + mw.2000s$HRnay) -
	(mw.2000s$HDyea - mw.2000s$HDnay)/
	(mw.2000s$HDyea + mw.2000s$HDnay)), na.rm = T),
	mean(abs((mw.2000s$SRyea - mw.2000s$SRnay)/
	(mw.2000s$SRyea + mw.2000s$SRnay) -
	(mw.2000s$SDyea - mw.2000s$SDnay)/
	(mw.2000s$SDyea + mw.2000s$SDnay)), na.rm = T))

mw.pcts <- data.frame(rbind(abs.mw.6, abs.mw.7, 
	abs.mw.8, abs.mw.9, abs.mw.0))
rownames(mw.pcts) <- c("Wage.60s", "Wage.70s", "Wage.80s",
	"Wage.90s", "Wage.00s")



## WELFARE ##
welf.1960s <- data.frame(subset(data, 
	data$Issue == "Welfare" & data$Year < 1970))
welf.1970s <- data.frame(subset(data, 
	data$Issue == "Welfare" & (data$Year >= 1970 & data$Year <1980)))
welf.1980s <- data.frame(subset(data, 
	data$Issue == "Welfare" & (data$Year >= 1980 & data$Year <1990)))
welf.1990s <- data.frame(subset(data, 
	data$Issue == "Welfare" & (data$Year >= 1990 & data$Year <2000)))
welf.2000s <- data.frame(subset(data, 
	data$Issue == "Welfare" & data$Year >= 2000))

abs.welf.6 <- cbind(mean(abs(welf.1960s$HRyea - welf.1960s$HRnay)/
	(welf.1960s$HRyea + welf.1960s$HRnay), na.rm = T),
	mean(abs(welf.1960s$HDyea - welf.1960s$HDnay)/
	(welf.1960s$HDyea + welf.1960s$HDnay), na.rm = T),
	mean(abs(welf.1960s$SRyea - welf.1960s$SRnay)/
	(welf.1960s$SRyea + welf.1960s$SRnay), na.rm = T),
	mean(abs(welf.1960s$SDyea - welf.1960s$SDnay)/
	(welf.1960s$SDyea + welf.1960s$SDnay), na.rm = T),
	mean(abs((welf.1960s$HRyea - welf.1960s$HRnay)/
	(welf.1960s$HRyea + welf.1960s$HRnay) -
	(welf.1960s$HDyea - welf.1960s$HDnay)/
	(welf.1960s$HDyea + welf.1960s$HDnay)), na.rm = T),
	mean(abs((welf.1960s$SRyea - welf.1960s$SRnay)/
	(welf.1960s$SRyea + welf.1960s$SRnay) -
	(welf.1960s$SDyea - welf.1960s$SDnay)/
	(welf.1960s$SDyea + welf.1960s$SDnay)), na.rm = T))
abs.welf.7 <- cbind(mean(abs(welf.1970s$HRyea - welf.1970s$HRnay)/
	(welf.1970s$HRyea + welf.1970s$HRnay), na.rm = T),
	mean(abs(welf.1970s$HDyea - welf.1970s$HDnay)/
	(welf.1970s$HDyea + welf.1970s$HDnay), na.rm = T),
	mean(abs(welf.1970s$SRyea - welf.1970s$SRnay)/
	(welf.1970s$SRyea + welf.1970s$SRnay), na.rm = T),
	mean(abs(welf.1970s$SDyea - welf.1970s$SDnay)/
	(welf.1970s$SDyea + welf.1970s$SDnay), na.rm = T),
	mean(abs((welf.1970s$HRyea - welf.1970s$HRnay)/
	(welf.1970s$HRyea + welf.1970s$HRnay) -
	(welf.1970s$HDyea - welf.1970s$HDnay)/
	(welf.1970s$HDyea + welf.1970s$HDnay)), na.rm = T),
	mean(abs((welf.1970s$SRyea - welf.1970s$SRnay)/
	(welf.1970s$SRyea + welf.1970s$SRnay) -
	(welf.1970s$SDyea - welf.1970s$SDnay)/
	(welf.1970s$SDyea + welf.1970s$SDnay)), na.rm = T))
abs.welf.8 <- cbind(mean(abs(welf.1980s$HRyea - welf.1980s$HRnay)/
	(welf.1980s$HRyea + welf.1980s$HRnay), na.rm = T),
	mean(abs(welf.1980s$HDyea - welf.1980s$HDnay)/
	(welf.1980s$HDyea + welf.1980s$HDnay), na.rm = T),
	mean(abs(welf.1980s$SRyea - welf.1980s$SRnay)/
	(welf.1980s$SRyea + welf.1980s$SRnay), na.rm = T),
	mean(abs(welf.1980s$SDyea - welf.1980s$SDnay)/
	(welf.1980s$SDyea + welf.1980s$SDnay), na.rm = T),
	mean(abs((welf.1980s$HRyea - welf.1980s$HRnay)/
	(welf.1980s$HRyea + welf.1980s$HRnay) -
	(welf.1980s$HDyea - welf.1980s$HDnay)/
	(welf.1980s$HDyea + welf.1980s$HDnay)), na.rm = T),
	mean(abs((welf.1980s$SRyea - welf.1980s$SRnay)/
	(welf.1980s$SRyea + welf.1980s$SRnay) -
	(welf.1980s$SDyea - welf.1980s$SDnay)/
	(welf.1980s$SDyea + welf.1980s$SDnay)), na.rm = T))
abs.welf.9 <- cbind(mean(abs(welf.1990s$HRyea - welf.1990s$HRnay)/
	(welf.1990s$HRyea + welf.1990s$HRnay), na.rm = T),
	mean(abs(welf.1990s$HDyea - welf.1990s$HDnay)/
	(welf.1990s$HDyea + welf.1990s$HDnay), na.rm = T),
	mean(abs(welf.1990s$SRyea - welf.1990s$SRnay)/
	(welf.1990s$SRyea + welf.1990s$SRnay), na.rm = T),
	mean(abs(welf.1990s$SDyea - welf.1990s$SDnay)/
	(welf.1990s$SDyea + welf.1990s$SDnay), na.rm = T),
	mean(abs((welf.1990s$HRyea - welf.1990s$HRnay)/
	(welf.1990s$HRyea + welf.1990s$HRnay) -
	(welf.1990s$HDyea - welf.1990s$HDnay)/
	(welf.1990s$HDyea + welf.1990s$HDnay)), na.rm = T),
	mean(abs((welf.1990s$SRyea - welf.1990s$SRnay)/
	(welf.1990s$SRyea + welf.1990s$SRnay) -
	(welf.1990s$SDyea - welf.1990s$SDnay)/
	(welf.1990s$SDyea + welf.1990s$SDnay)), na.rm = T))
abs.welf.0 <- cbind(mean(abs(welf.2000s$HRyea - welf.2000s$HRnay)/
	(welf.2000s$HRyea + welf.2000s$HRnay), na.rm = T),
	mean(abs(welf.2000s$HDyea - welf.2000s$HDnay)/
	(welf.2000s$HDyea + welf.2000s$HDnay), na.rm = T),
	mean(abs(welf.2000s$SRyea - welf.2000s$SRnay)/
	(welf.2000s$SRyea + welf.2000s$SRnay), na.rm = T),
	mean(abs(welf.2000s$SDyea - welf.2000s$SDnay)/
	(welf.2000s$SDyea + welf.2000s$SDnay), na.rm = T),
	mean(abs((welf.2000s$HRyea - welf.2000s$HRnay)/
	(welf.2000s$HRyea + welf.2000s$HRnay) -
	(welf.2000s$HDyea - welf.2000s$HDnay)/
	(welf.2000s$HDyea + welf.2000s$HDnay)), na.rm = T),
	mean(abs((welf.2000s$SRyea - welf.2000s$SRnay)/
	(welf.2000s$SRyea + welf.2000s$SRnay) -
	(welf.2000s$SDyea - welf.2000s$SDnay)/
	(welf.2000s$SDyea + welf.2000s$SDnay)), na.rm = T))

welf.pcts <- data.frame(rbind(abs.welf.6, abs.welf.7, 
	abs.welf.8, abs.welf.9, abs.welf.0))
rownames(welf.pcts) <- c("Welfare.60s", "Welfare.70s", "Welfare.80s",
	"Welfare.90s", "Welfare.00s")


## VETERANS ##
vets.1960s <- data.frame(subset(data, 
	data$Issue == "Veterans" & data$Year < 1970))
vets.1970s <- data.frame(subset(data, 
	data$Issue == "Veterans" & (data$Year >= 1970 & data$Year <1980)))
vets.1980s <- data.frame(subset(data, 
	data$Issue == "Veterans" & (data$Year >= 1980 & data$Year <1990)))
vets.1990s <- data.frame(subset(data, 
	data$Issue == "Veterans" & (data$Year >= 1990 & data$Year <2000)))
vets.2000s <- data.frame(subset(data, 
	data$Issue == "Veterans" & data$Year >= 2000))

abs.vets.6 <- cbind(mean(abs(vets.1960s$HRyea - vets.1960s$HRnay)/
	(vets.1960s$HRyea + vets.1960s$HRnay), na.rm = T),
	mean(abs(vets.1960s$HDyea - vets.1960s$HDnay)/
	(vets.1960s$HDyea + vets.1960s$HDnay), na.rm = T),
	mean(abs(vets.1960s$SRyea - vets.1960s$SRnay)/
	(vets.1960s$SRyea + vets.1960s$SRnay), na.rm = T),
	mean(abs(vets.1960s$SDyea - vets.1960s$SDnay)/
	(vets.1960s$SDyea + vets.1960s$SDnay), na.rm = T),
	mean(abs((vets.1960s$HRyea - vets.1960s$HRnay)/
	(vets.1960s$HRyea + vets.1960s$HRnay) -
	(vets.1960s$HDyea - vets.1960s$HDnay)/
	(vets.1960s$HDyea + vets.1960s$HDnay)), na.rm = T),
	mean(abs((vets.1960s$SRyea - vets.1960s$SRnay)/
	(vets.1960s$SRyea + vets.1960s$SRnay) -
	(vets.1960s$SDyea - vets.1960s$SDnay)/
	(vets.1960s$SDyea + vets.1960s$SDnay)), na.rm = T))
abs.vets.7 <- cbind(mean(abs(vets.1970s$HRyea - vets.1970s$HRnay)/
	(vets.1970s$HRyea + vets.1970s$HRnay), na.rm = T),
	mean(abs(vets.1970s$HDyea - vets.1970s$HDnay)/
	(vets.1970s$HDyea + vets.1970s$HDnay), na.rm = T),
	mean(abs(vets.1970s$SRyea - vets.1970s$SRnay)/
	(vets.1970s$SRyea + vets.1970s$SRnay), na.rm = T),
	mean(abs(vets.1970s$SDyea - vets.1970s$SDnay)/
	(vets.1970s$SDyea + vets.1970s$SDnay), na.rm = T),
	mean(abs((vets.1970s$HRyea - vets.1970s$HRnay)/
	(vets.1970s$HRyea + vets.1970s$HRnay) -
	(vets.1970s$HDyea - vets.1970s$HDnay)/
	(vets.1970s$HDyea + vets.1970s$HDnay)), na.rm = T),
	mean(abs((vets.1970s$SRyea - vets.1970s$SRnay)/
	(vets.1970s$SRyea + vets.1970s$SRnay) -
	(vets.1970s$SDyea - vets.1970s$SDnay)/
	(vets.1970s$SDyea + vets.1970s$SDnay)), na.rm = T))
abs.vets.8 <- cbind(mean(abs(vets.1980s$HRyea - vets.1980s$HRnay)/
	(vets.1980s$HRyea + vets.1980s$HRnay), na.rm = T),
	mean(abs(vets.1980s$HDyea - vets.1980s$HDnay)/
	(vets.1980s$HDyea + vets.1980s$HDnay), na.rm = T),
	mean(abs(vets.1980s$SRyea - vets.1980s$SRnay)/
	(vets.1980s$SRyea + vets.1980s$SRnay), na.rm = T),
	mean(abs(vets.1980s$SDyea - vets.1980s$SDnay)/
	(vets.1980s$SDyea + vets.1980s$SDnay), na.rm = T),
	mean(abs((vets.1980s$HRyea - vets.1980s$HRnay)/
	(vets.1980s$HRyea + vets.1980s$HRnay) -
	(vets.1980s$HDyea - vets.1980s$HDnay)/
	(vets.1980s$HDyea + vets.1980s$HDnay)), na.rm = T),
	mean(abs((vets.1980s$SRyea - vets.1980s$SRnay)/
	(vets.1980s$SRyea + vets.1980s$SRnay) -
	(vets.1980s$SDyea - vets.1980s$SDnay)/
	(vets.1980s$SDyea + vets.1980s$SDnay)), na.rm = T))
abs.vets.9 <- cbind(mean(abs(vets.1990s$HRyea - vets.1990s$HRnay)/
	(vets.1990s$HRyea + vets.1990s$HRnay), na.rm = T),
	mean(abs(vets.1990s$HDyea - vets.1990s$HDnay)/
	(vets.1990s$HDyea + vets.1990s$HDnay), na.rm = T),
	mean(abs(vets.1990s$SRyea - vets.1990s$SRnay)/
	(vets.1990s$SRyea + vets.1990s$SRnay), na.rm = T),
	mean(abs(vets.1990s$SDyea - vets.1990s$SDnay)/
	(vets.1990s$SDyea + vets.1990s$SDnay), na.rm = T),
	mean(abs((vets.1990s$HRyea - vets.1990s$HRnay)/
	(vets.1990s$HRyea + vets.1990s$HRnay) -
	(vets.1990s$HDyea - vets.1990s$HDnay)/
	(vets.1990s$HDyea + vets.1990s$HDnay)), na.rm = T),
	mean(abs((vets.1990s$SRyea - vets.1990s$SRnay)/
	(vets.1990s$SRyea + vets.1990s$SRnay) -
	(vets.1990s$SDyea - vets.1990s$SDnay)/
	(vets.1990s$SDyea + vets.1990s$SDnay)), na.rm = T))
abs.vets.0 <- cbind(mean(abs(vets.2000s$HRyea - vets.2000s$HRnay)/
	(vets.2000s$HRyea + vets.2000s$HRnay), na.rm = T),
	mean(abs(vets.2000s$HDyea - vets.2000s$HDnay)/
	(vets.2000s$HDyea + vets.2000s$HDnay), na.rm = T),
	mean(abs(vets.2000s$SRyea - vets.2000s$SRnay)/
	(vets.2000s$SRyea + vets.2000s$SRnay), na.rm = T),
	mean(abs(vets.2000s$SDyea - vets.2000s$SDnay)/
	(vets.2000s$SDyea + vets.2000s$SDnay), na.rm = T),
	mean(abs((vets.2000s$HRyea - vets.2000s$HRnay)/
	(vets.2000s$HRyea + vets.2000s$HRnay) -
	(vets.2000s$HDyea - vets.2000s$HDnay)/
	(vets.2000s$HDyea + vets.2000s$HDnay)), na.rm = T),
	mean(abs((vets.2000s$SRyea - vets.2000s$SRnay)/
	(vets.2000s$SRyea + vets.2000s$SRnay) -
	(vets.2000s$SDyea - vets.2000s$SDnay)/
	(vets.2000s$SDyea + vets.2000s$SDnay)), na.rm = T))

vets.pcts <- data.frame(rbind(abs.vets.6, abs.vets.7, 
	abs.vets.8, abs.vets.9, abs.vets.0))
rownames(vets.pcts) <- c("Veterans.60s", "Veterans.70s", "Veterans.80s",
	"Veterans.90s", "Veterans.00s")


## WOMEN ##
women.1960s <- data.frame(subset(data, 
	data$Issue == "Women" & data$Year < 1970))
women.1970s <- data.frame(subset(data, 
	data$Issue == "Women" & (data$Year >= 1970 & data$Year <1980)))
women.1980s <- data.frame(subset(data, 
	data$Issue == "Women" & (data$Year >= 1980 & data$Year <1990)))
women.1990s <- data.frame(subset(data, 
	data$Issue == "Women" & (data$Year >= 1990 & data$Year <2000)))
women.2000s <- data.frame(subset(data, 
	data$Issue == "Women" & data$Year >= 2000))

abs.women.6 <- cbind(mean(abs(women.1960s$HRyea - women.1960s$HRnay)/
	(women.1960s$HRyea + women.1960s$HRnay), na.rm = T),
	mean(abs(women.1960s$HDyea - women.1960s$HDnay)/
	(women.1960s$HDyea + women.1960s$HDnay), na.rm = T),
	mean(abs(women.1960s$SRyea - women.1960s$SRnay)/
	(women.1960s$SRyea + women.1960s$SRnay), na.rm = T),
	mean(abs(women.1960s$SDyea - women.1960s$SDnay)/
	(women.1960s$SDyea + women.1960s$SDnay), na.rm = T),
	mean(abs((women.1960s$HRyea - women.1960s$HRnay)/
	(women.1960s$HRyea + women.1960s$HRnay) -
	(women.1960s$HDyea - women.1960s$HDnay)/
	(women.1960s$HDyea + women.1960s$HDnay)), na.rm = T),
	mean(abs((women.1960s$SRyea - women.1960s$SRnay)/
	(women.1960s$SRyea + women.1960s$SRnay) -
	(women.1960s$SDyea - women.1960s$SDnay)/
	(women.1960s$SDyea + women.1960s$SDnay)), na.rm = T))
abs.women.7 <- cbind(mean(abs(women.1970s$HRyea - women.1970s$HRnay)/
	(women.1970s$HRyea + women.1970s$HRnay), na.rm = T),
	mean(abs(women.1970s$HDyea - women.1970s$HDnay)/
	(women.1970s$HDyea + women.1970s$HDnay), na.rm = T),
	mean(abs(women.1970s$SRyea - women.1970s$SRnay)/
	(women.1970s$SRyea + women.1970s$SRnay), na.rm = T),
	mean(abs(women.1970s$SDyea - women.1970s$SDnay)/
	(women.1970s$SDyea + women.1970s$SDnay), na.rm = T),
	mean(abs((women.1970s$HRyea - women.1970s$HRnay)/
	(women.1970s$HRyea + women.1970s$HRnay) -
	(women.1970s$HDyea - women.1970s$HDnay)/
	(women.1970s$HDyea + women.1970s$HDnay)), na.rm = T),
	mean(abs((women.1970s$SRyea - women.1970s$SRnay)/
	(women.1970s$SRyea + women.1970s$SRnay) -
	(women.1970s$SDyea - women.1970s$SDnay)/
	(women.1970s$SDyea + women.1970s$SDnay)), na.rm = T))
abs.women.8 <- cbind(mean(abs(women.1980s$HRyea - women.1980s$HRnay)/
	(women.1980s$HRyea + women.1980s$HRnay), na.rm = T),
	mean(abs(women.1980s$HDyea - women.1980s$HDnay)/
	(women.1980s$HDyea + women.1980s$HDnay), na.rm = T),
	mean(abs(women.1980s$SRyea - women.1980s$SRnay)/
	(women.1980s$SRyea + women.1980s$SRnay), na.rm = T),
	mean(abs(women.1980s$SDyea - women.1980s$SDnay)/
	(women.1980s$SDyea + women.1980s$SDnay), na.rm = T),
	mean(abs((women.1980s$HRyea - women.1980s$HRnay)/
	(women.1980s$HRyea + women.1980s$HRnay) -
	(women.1980s$HDyea - women.1980s$HDnay)/
	(women.1980s$HDyea + women.1980s$HDnay)), na.rm = T),
	mean(abs((women.1980s$SRyea - women.1980s$SRnay)/
	(women.1980s$SRyea + women.1980s$SRnay) -
	(women.1980s$SDyea - women.1980s$SDnay)/
	(women.1980s$SDyea + women.1980s$SDnay)), na.rm = T))
abs.women.9 <- cbind(mean(abs(women.1990s$HRyea - women.1990s$HRnay)/
	(women.1990s$HRyea + women.1990s$HRnay), na.rm = T),
	mean(abs(women.1990s$HDyea - women.1990s$HDnay)/
	(women.1990s$HDyea + women.1990s$HDnay), na.rm = T),
	mean(abs(women.1990s$SRyea - women.1990s$SRnay)/
	(women.1990s$SRyea + women.1990s$SRnay), na.rm = T),
	mean(abs(women.1990s$SDyea - women.1990s$SDnay)/
	(women.1990s$SDyea + women.1990s$SDnay), na.rm = T),
	mean(abs((women.1990s$HRyea - women.1990s$HRnay)/
	(women.1990s$HRyea + women.1990s$HRnay) -
	(women.1990s$HDyea - women.1990s$HDnay)/
	(women.1990s$HDyea + women.1990s$HDnay)), na.rm = T),
	mean(abs((women.1990s$SRyea - women.1990s$SRnay)/
	(women.1990s$SRyea + women.1990s$SRnay) -
	(women.1990s$SDyea - women.1990s$SDnay)/
	(women.1990s$SDyea + women.1990s$SDnay)), na.rm = T))
abs.women.0 <- cbind(mean(abs(women.2000s$HRyea - women.2000s$HRnay)/
	(women.2000s$HRyea + women.2000s$HRnay), na.rm = T),
	mean(abs(women.2000s$HDyea - women.2000s$HDnay)/
	(women.2000s$HDyea + women.2000s$HDnay), na.rm = T),
	mean(abs(women.2000s$SRyea - women.2000s$SRnay)/
	(women.2000s$SRyea + women.2000s$SRnay), na.rm = T),
	mean(abs(women.2000s$SDyea - women.2000s$SDnay)/
	(women.2000s$SDyea + women.2000s$SDnay), na.rm = T),
	mean(abs((women.2000s$HRyea - women.2000s$HRnay)/
	(women.2000s$HRyea + women.2000s$HRnay) -
	(women.2000s$HDyea - women.2000s$HDnay)/
	(women.2000s$HDyea + women.2000s$HDnay)), na.rm = T),
	mean(abs((women.2000s$SRyea - women.2000s$SRnay)/
	(women.2000s$SRyea + women.2000s$SRnay) -
	(women.2000s$SDyea - women.2000s$SDnay)/
	(women.2000s$SDyea + women.2000s$SDnay)), na.rm = T))

women.pcts <- data.frame(rbind(abs.women.6, abs.women.7, 
	abs.women.8, abs.women.9, abs.women.0))
rownames(women.pcts) <- c("Women.60s", "Women.70s", "Women.80s",
	"Women.90s", "Women.00s")


subset(data, data$Issue == "Climate")
table(data$Issue)

abort.pcts
climate.pcts
death.pcts
guns.pcts
lurid.pcts
post.pcts
mw.pcts
welf.pcts
vets.pcts
women.pcts

data2 <- data.frame(rbind(abort.pcts, climate.pcts, death.pcts,
	guns.pcts, lurid.pcts, post.pcts, mw.pcts, welf.pcts,
	vets.pcts, women.pcts))


data.col.names <- c("HRpct", "HDpct", "SRpct", "SDpct", "House.Side", "Senate.Side")
colnames(data2) <- data.col.names

data.60s <- data.frame(rbind(data2[seq(1, 46, 5),]))
data.70s <- data.frame(rbind(data2[seq(2, 47, 5),]))
data.80s <- data.frame(rbind(data2[seq(3, 48, 5),]))
data.90s <- data.frame(rbind(data2[seq(4, 49, 5),]))
data.00s <- data.frame(rbind(data2[seq(5, 50, 5),]))

# Each of these contains six variables, created above.
# HRpct measures the proportion of Republicans voting together on some issue.
#  The minimum is zero (50-50) split, and the maximum is one (all vote together)
#  0.50 on this measure is a (1/4) to (3/4) split (mean across votes in decade)
# HDpct, SRpct, and SDpct are the same thing for Reps and Dems, by chamber
# House Side measures the DISSIMILARITY of Rep/Dem positions
#  It is the absolute value of the proportion of Republicans voting in 
#  some direction from the proportion of Democrats voting in some direction.
#  So if Republicans vote positive and Democrats vote positive, + - + = 0
#   Neg - Pos = Larger difference
#   Pos - Neg = Larger difference
#   Neg - Neg [same direction] = Smaller difference
#   It ranges from 0 (an equal proportion of each party voting in the same
#   direction) to 2 (all members of both parties voting in opposite directions)
# Senate Side measures the same thing in the Senate

names(abort.pcts) <- names(climate.pcts) <- names(death.pcts) <- 
	names(guns.pcts) <- names(lurid.pcts) <- names(post.pcts) <-
	names(mw.pcts) <- names(welf.pcts) <- names(vets.pcts) <-
	names(women.pcts) <- data.col.names

# Three sets of data sets. All data
data2

# Issues by years
climate.pcts
death.pcts
guns.pcts
lurid.pcts
post.pcts
mw.pcts
welf.pcts
vets.pcts
women.pcts

# And years by issues
data.60s
data.70s
data.80s
data.90s
data.00s

names(data2) 

data2$X
data2$Issue <- c(rep("Abortion", 5), rep("Climate", 5), rep("Death", 5), 
	rep("Guns", 5), rep("Lurid", 5), rep("Post Office", 5), 
	rep("Minimum Wage", 5), rep("Welfare", 5), rep("Veterans", 5),
	rep("Women", 5))
data2$Year <- rep(seq(1960, 2000, 10), 10)

# House: minus death (11-15), post office (26-30), 
#  minimum wage (31-35), and welfare (36-40)
data3 <- data2[c(1:10, 16:25, 41:50),]
data3

# Add in Military Spending
data4 <- rbind(data3, NA, NA, NA, NA, NA)
data4$House.Side[31:35] <- c(0.13, 0.31, 0.56, 0.62, 0.58)
data4$Issue[31:35] <- rep("Military", 5)
data4$Year[31:35] <- seq(1960, 2000, 10)


# Figure 3
pdf("*", width = 7, height = 4)
p <- ggplot(data4, aes(x = Year, y = House.Side, group = Issue))
p + geom_point(aes(pch = Issue), size = 3) + 
	theme(axis.text.x = element_text(colour="black", size = 13), 
		axis.text.y = element_text(colour="black", size = 13), 
		axis.title.x = element_text(size = 20),
		axis.title.y = element_text(size = 16),
		legend.text = element_text(size = 13), 
		legend.position = "right") +
	ylab("Inter-Party Opposition") + 
	xlab("Decade") +
	scale_shape_manual(values = c(1:7)) +
	geom_line(data = data4[!is.na(data4$House.Side),])
dev.off()




